package com.taorenqi.business.adapter;

import android.widget.LinearLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.taorenqi.business.R;
import com.taorenqi.business.app.MyApp;
import com.taorenqi.business.helper.RecyclerViewHolder;
import com.taorenqi.data.entity.mine.GiftEntity;
import com.taorenqi.data.entity.mine.MessageEntity;

import java.util.List;

/**
 * Created by eric on 2017/9/26.
 */

public class MessageAdapter extends BaseQuickAdapter<MessageEntity,RecyclerViewHolder> {



    public MessageAdapter(List<MessageEntity> commonEntityList) {
        super(R.layout.item_recyclerview_message,commonEntityList);

    }
    @Override
    protected void convert(final RecyclerViewHolder helper, MessageEntity item) {
        if (item != null){

            helper
                    .setText(R.id.item_message_title,item.getNews_title())

            ;

            if (1 == item.getNews_type()){//网站公告
                helper.setText(R.id.item_message_type,"【网站公告】");
            } else if (2 == item.getNews_type()){//常见问题
                helper.setText(R.id.item_message_type,"【常见问题】");
            }

        }
    }
}